package 字符串;

/**
 * @author mubei
 * @date 2021/12/14
 * @description
 */
public class Demo01 {


    public boolean isUnique(String astr) {
        int arr[] = new int[26];
        int barr[] = new  int [26];
        char chars[] = astr.toCharArray();
        for (int i = 0; i < chars.length; i ++){
            if(chars[i] >= 'a' && chars[i] <= 'z'){
                arr[chars[i] - 'a'] ++;
                if(arr[chars[i] - 'a'] > 1){
                    return false;
                }
            }else{
                barr[chars[i] - 'A'] ++;
                if(barr[chars[i] - 'A'] > 1){
                    return false;
                }
            }
        }
        return true;
    }
}
